package cn.com.self.apis.controller;


import cn.com.self.apis.portal.entity.RequirementsEntity;
import cn.com.self.apis.portal.entity.TransactionRecordEntity;
import cn.com.self.apis.portal.mapper.TransactionRecordMapper;
import cn.com.self.apis.portal.service.intf.ITransactionRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 * @author1 ssh
 * @author2
 * @date 2021-04-28
 */
@Controller
@Api(tags = "个人中心-订单中心")
public class PersonalOrderController {

    @Autowired
    ITransactionRecordService transactionRecordService;
    @Autowired
    TransactionRecordMapper transactionRecordMapper;

    @GetMapping(value = {"/transaction/load/obj/{obj_id}"})
    @ApiOperation(value = "会员获取交易记录")
    public ResponseEntity loadId(@PathVariable("obj_id") String obj_id, HttpServletRequest request) {
        Map<String, Object> map = new HashMap(1);
        map.put("obj_id", obj_id);
        List<TransactionRecordEntity> transactionRecordEntities = transactionRecordMapper.selectByMap(map);
        return ResponseEntity.status(HttpStatus.OK).body(new cn.com.self.apis.core.vo.ResultModel<>(transactionRecordEntities));
    }

}

